home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 12475 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: news.spies.com!usenet
  2. From: Erik Max Francis <max@alcyone.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: casting const
  5. Date: Sun, 31 Mar 1996 20:02:40 -0800
  6. Organization: Alcyone Systems
  7. Message-ID: <315F5560.7E39BE22@alcyone.com>
  8. References: <4jf4f5$3aa@news.aladdin.co.uk>
  9. NNTP-Posting-Host: newton.alcyone.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.01 (X11; I; Linux 1.2.13 i486)
  14.  
  15. Rob Catling wrote:
  16.  
  17. > I was wondering why you could pass a char * value as an argument to
  18. > func(const char *) with no problem, but passing char ** value to
  19. > func(const char **) gives a compiler warning (unless you cast it).
  20.  
  21. The reason is because a const char ** is a pointer to pointer to constant char, not
  22. a pointer to constant pointer to char.  With a function declared as taking an
  23. argument of type char *const * would have been implicitly converted without
  24. complaint.
  25.  
  26. -- 
  27. Erik Max Francis &tSftDotIotE && http://www.alcyone.com/max && max@alcyone.com
  28. San Jose, California, U.S.A. && 37 20 07 N 121 53 38 W && the 4th R is respect
  29. H.3`S,3,P,3$S,#$Q,C`Q,3,P,3$S,#$Q,3`Q,3,P,C$Q,#(Q.#`-"C`- && 1love && folasade
  30. Omnia quia sunt, lumina sunt. && Dominion, GIGO, GOOGOL, Omega, Psi, Strategem
  31. "Out from his breast/his soul went to seek/the doom of the just." -- _Beowulf_
  32.